package com.db;

import java.sql.ResultSet;
import java.util.List;

import com.entity.Liuyanban;
import com.entity.User;

public class LiuyanbanDao extends BaseDao<Liuyanban>{
	
	public void addliuyan(Liuyanban liuyanban) {
		String sql="insert into liuyanban values (?,?)";
		super.add(sql,liuyanban.getId(),liuyanban.getStr());
	}
	public List<Liuyanban> queryallliuyan(){
		String sql="select * from liuyanban";
		return super.queryall(sql);
	}
	public Liuyanban queryliuyan(int id) {
		String sql="select * from liuyanban where id='"+id+"'";
		return super.query(sql);
	}
	@Override
	protected Liuyanban getEntity(ResultSet rs) {
		Liuyanban liuyanban = new Liuyanban();
		try {
			liuyanban.setId(rs.getInt("id"));
			liuyanban.setStr(rs.getString("str"));
		} catch (Exception e) {
			// TODO: handle exception
		}
		return liuyanban;
	}

}
